<?php
    $time = microtime();

    require '../../conf/lock.php';

    $requerimento = new acadRequerimentosRecord();
	$lib = new Lib();
	
	$codRequerimento = $_GET['codRequerimento'];
	
	$dados = $requerimento->dadosRequerimento($codRequerimento);
	
	$tpl = new sistTemplate(APPTPLDIR.'/requerimento.tpl.html');
    $tpl->addFile('TOPO', APPTPLDIR.'/topo.tpl.html');
    $tpl->addFile('MENULATERAL', APPTPLDIR.'/menuLateral.tpl.html');
    $tpl->addFile('RODAPE', APPTPLDIR.'/rodape.tpl.html');
    $tpl->IMAGEDIR = APPIMAGEDIR;
    $tpl->CSSDIR = APPCSSDIR;
    $tpl->JSDIR = APPJSDIR;
    $tpl->WEBROOT = APPWEBROOT;
    $tpl->SITETITLE = SITETITLE;
    $tpl->FAVICON = FAVICON;
    $tpl->ANIMATEDFAVICON = ANIMATEDFAVICON;
    $tpl->MEMORYUSAGE = number_format(intval(memory_get_usage()/1000), 0, ',', '.');
    $tpl->MEMORYPICK = number_format(intval(memory_get_peak_usage()/1000),0,',','.');
	$tpl->CONTROLLER = '../controllers/requerimento.php?acao=edit';
	$tpl->NOME = $lib->formatarNome($dados['NOME']['0']);
	$tpl->DESCRICAO = $lib->formatarNome($dados['DESCRICAO']['0']);
	
	if($dados['PORTAL'] == '1')
	{
		$tpl->PORTAL = 'checked';
	} else
	{
		$tpl->PORTAL = '';
	}
	
	$tpl->CODREQUERIMENTO = $codRequerimento;

    $tpl->DICA = 'Lorem ipsum dolor sit amet, consectetur
        adipiscing elit. Duis sollicitudin ultrices
        erat vitae sodales. Duis pretium mollis
        risus, sed pellentesque diam accumsan
        et. Vivamus sapien lorem, ullamcorper
        n auctor non, lacinia et arcu.
        Maecenas condimentum tincidunt
        massa.';    

    $tpl->TIME = number_format((microtime() - $time),3,',','.');
    $tpl->show();
?>